package com.approval.approvalapp.util.net;

import android.util.Log;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

/**
 * Created by louyulin on 2019/5/16.
 */

public class CreateJsonUtil {

    public static String creteJsonStr (HashMap<String , Object> map){
        JSONObject jsonObject = new JSONObject();
        Iterator<Map.Entry<String, Object>> iterator = map.entrySet().iterator();
        while (iterator.hasNext()){
            Map.Entry<String, Object> next = iterator.next();
            String key = next.getKey();
            Object value = next.getValue();
            jsonObject.put(key , value);
        }

        String s = jsonObject.toString();
        Log.d("CreateJsonUtil", s);
        return s;
    }
}
